# coding: utf-8
from PySide6.QtWidgets import QPlainTextEdit, QTextBrowser
from qfluentwidgets import SmoothScrollDelegate, FluentStyleSheet, setFont
from qfluentwidgets.components.widgets.line_edit import EditLayer

from common import StyleSheet


class PlainTextEdit(QPlainTextEdit):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.layer = EditLayer(self)
        self.scrollDelegate = SmoothScrollDelegate(self)
        setFont(self, 14)
        FluentStyleSheet.LINE_EDIT.apply(self)


class TextBrowser(QTextBrowser):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.scrollDelegate = SmoothScrollDelegate(self)
        StyleSheet.TextWidget.apply(self)
